import Vue from 'vue';
import Router from 'vue-router';
const Echarts = () => import('@/pages/echarts.vue')
const ViewList = () => import('@/pages/view-list');
const ViewDetail = () => import('@/pages/view-detail');
const ViewDetailInfo = () => import('@/pages/view-detail-info');
const Index = () => import('@/pages/index');
const CreateWork = () => import('@/pages/createWork')
const WorkBoard = () => import('@/pages/workBoard')
const LoadWork = () => import('@/pages/loadWork')
const EditWork = () => import ("@/pages/editWork")

Vue.use(Router);

const router = new Router({
  routes: [
    {
       path:"/",
       name:"WorkBoard",
       component: WorkBoard,
       redirect:"/WorkBoard",
       meta: {
        title: '工作看板',
        keepAlive: true,
      },
    },
    {
      path: '/WorkBoard',
      name: 'WorkBoard', // name是@/pages/view-list组件中的name值
      component: WorkBoard,
      meta: {
        title: '工作看板',
        keepAlive: true,
      },
    },
    {
      path: '/createWork',
      name: 'CreateWork', // name是@/pages/view-list组件中的name值
      component: CreateWork,
      meta: {
        title: '创建工作',
      },
    },
    {
      path: '/loadWork',
      name: 'LoadWork',
      component: LoadWork,
      meta: {
        title: '加载工作'
      }
    },
    {
      path: '/editWork',
      name: 'EditWork',
      component: EditWork,
      meta: {
        title: '编辑工作'
      }
    },
    {
      path: '/viewList',
      name: 'ViewList', // name是@/pages/view-list组件中的name值
      component: ViewList,
      meta: {
        title: '列表',
      },
    },
    {
      path: '/view-detail',
      name: 'ViewDetail',
      component: ViewDetail,
      meta: {
        title: '详情',
      },
    },
    {
      path: '/view-detail-info',
      name: 'ViewDetailInfo',
      component: ViewDetailInfo,
      meta: {
        title: '详情细节',
      },
    },
    {
      path:'/echarts',
      name:'Echarts',
      component:Echarts,
      meta: {
        title: '图表',
      },
    }
  ],
});
router.beforeEach((to, from, next) => {
  next();
});

export default router;
